/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.financeiro.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author joao
 */
@Entity
@Table(name = "modulo", catalog = "salao", schema = "public")
public class Modulo implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "modulo_id_modulo_seq")
    @SequenceGenerator(name = "modulo_id_modulo_seq", sequenceName = "modulo_id_modulo_seq", initialValue = 1, allocationSize = 1)
    @Basic(optional = false)
    @Column(name = "id_modulo", nullable = false)
    private Integer idModulo;
    @Column(name = "dsc_modulo", length = 50)
    private String dscModulo;
    @Column(name = "dsc_pagina", length = 30)
    private String dscPagina;
    @Column(name = "num_nivel")
    private Integer numNivel;
    /*
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "modulo")
    private List<UsuarioModulo> usuarioModuloList;
    */

    public Modulo() {
    }

    public Modulo(Integer idModulo) {
        this.idModulo = idModulo;
    }

    public Integer getIdModulo() {
        return idModulo;
    }

    public void setIdModulo(Integer idModulo) {
        this.idModulo = idModulo;
    }

    public String getDscModulo() {
        return dscModulo;
    }

    public void setDscModulo(String dscModulo) {
        this.dscModulo = dscModulo;
    }

    public String getDscPagina() {
        return dscPagina;
    }

    public void setDscPagina(String dscPagina) {
        this.dscPagina = dscPagina;
    }

    public Integer getNumNivel() {
        return numNivel;
    }

    public void setNumNivel(Integer numNivel) {
        this.numNivel = numNivel;
    }
/*
    public List<UsuarioModulo> getUsuarioModuloList() {
        return usuarioModuloList;
    }

    public void setUsuarioModuloList(List<UsuarioModulo> usuarioModuloList) {
        this.usuarioModuloList = usuarioModuloList;
    }
*/
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idModulo != null ? idModulo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Modulo)) {
            return false;
        }
        Modulo other = (Modulo) object;
        if ((this.idModulo == null && other.idModulo != null) || (this.idModulo != null && !this.idModulo.equals(other.idModulo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.jm.financeiro.entity.Modulo[ idModulo=" + idModulo + " ]";
    }
}
